package cn.tedu.spring.dibase;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 依赖注入测试类
 */
public class TestUserDao {
    public static void main(String[] args) {
//        ApplicationContext context = new AnnotationConfigApplicationContext(
//                "cn.tedu.spring.dibase");
//        UserDao userDao = context.getBean(UserDao.class);
//        System.out.println("userDao="+userDao);

        //自动装配测试
        ApplicationContext context = new AnnotationConfigApplicationContext(
                "cn.tedu.spring.dibase");
        UserService userService = context.getBean(UserService.class);
        System.out.println("userService="+userService);

    }
}
